<template>
  <div v-show="item.isShow" class="f as pt10 pb10">
    <div
      :class="['nowrap mr10 tr', item.required ? 'need' : '']"
      :style="{
        width: item.isLabelWidth ? item.labelWidth + 'px' : 'auto',
      }"
    >
      {{item.label}}
    </div>
    <div :class="['f1 rel', item.errmsg ? 'error' : '']">
      <div class="">
        <div class="f bdledeef5 bdtedeef5" style="background:#F5F7FA;border-radius:5px 5px 0 0;">
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">药物名称</div>
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">用法</div>
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">用量</div>
          <div class="f ac xc bdredeef5 bdbedeef5 pt2 pb2" style="width:90px;">用药时间</div>
        </div>
        <div v-for="(tableItem, index) in tableData" :key="tableItem.id" class="f bdledeef5" :style="{borderRadius: index == tableData.length - 1 ? '0 0 5px 5px' : '0'}">
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">{{tableItem.name}}</div>
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">{{tableItem.useage == 0 ? tableItem.useageOther : tableItem._useage}}</div>
          <div class="f1 f ac xc bdredeef5 bdbedeef5 pt2 pb2">
            <div class="mr10">
              {{tableItem.frequency == 0 ? tableItem.frequencyOther : tableItem._frequency}}
            </div>
            每次{{tableItem.dosage}}
            {{tableItem.dosageUnit == 0 ? tableItem.dosageUniteOther : tableItem._dosageUnit}}
          </div>
          <div class="f ac xc bdredeef5 bdbedeef5 pt2 pb2"  style="width:90px;">
            {{tableItem.time}}{{tableItem._timeUnit}}
          </div>
        </div>
        <div v-if="tableData.length == 0" class="f ac xc bdledeef5 bdredeef5 bdbedeef5 pt5 pb5 g9">暂无数据</div>
      </div>
    </div>
  </div>
</template>
<script src='./index.js'></script>
<style src='./index.css' scoped>
</style>